//
//  PlaytourCustomCell.m
//  一点互助
//
//  Created by 张泊秋 on 16/9/1.
//  Copyright © 2016年 zhangboqiu. All rights reserved.
//

#import "PlaytourCustomCell.h"
#import <SDWebImage/UIImageView+WebCache.h>
#import "URLDefine.h"

@implementation PlaytourCustomCell

- (void)setModel:(PlaytourModel *)model {
    _model = model;
    NSString *str = [NSString stringWithFormat:@"%@%@",kGetPicURL,model.toAvatar];
    NSURL *url = [NSURL URLWithString:str];
    [self.headerImage sd_setImageWithURL:url completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, NSURL *imageURL) {
        
    }];
    self.niceName.text = model.toNiceName;
    self.time.text = model.time;
    self.title.text = model.title;
    
    float flag =  (int)(model.price * 100) % 100;
    if (flag == 0) {
         self.price.text = [NSString stringWithFormat:@"已打赏%.2lf元",model.price];
    }else {
        self.price.text = [NSString stringWithFormat:@"已打赏%.0lf元",model.price];
    }
   
    
}





@end
